<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <script src="../../../../libs/layui/layui.js"></script>
        <link rel="stylesheet" href="../../../../libs/layui/css/layui.css" />
        <title>Layui - 复选框 (v2.6.8)</title>
    </head>
    <body style="padding: 15px">
        <div class="layui-form">
            <input type="checkbox" name="write" title="写作" checked="" />
            <div class="layui-unselect layui-form-checkbox layui-form-checked"><span>写作</span><i class="layui-icon layui-icon-ok"></i></div>
            <input type="checkbox" name="dai" title="发呆" />
            <div class="layui-unselect layui-form-checkbox"><span>发呆</span><i class="layui-icon layui-icon-ok"></i></div>
            <input type="checkbox" name="jin" title="禁用" disabled="" />
            <div class="layui-unselect layui-form-checkbox layui-checkbox-disabled layui-disabled"><span>禁用</span><i class="layui-icon layui-icon-ok"></i></div>
            <input type="checkbox" name="write" title="写作" lay-skin="primary" checked="" />
            <div class="layui-unselect layui-form-checkbox layui-form-checked" lay-skin="primary"><span>写作</span><i class="layui-icon layui-icon-ok"></i></div>
            <input type="checkbox" name="dai" title="发呆" lay-skin="primary" />
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>发呆</span><i class="layui-icon layui-icon-ok"></i></div>
            <input type="checkbox" name="jin" title="禁用" lay-skin="primary" disabled="" />
            <div class="layui-unselect layui-form-checkbox layui-checkbox-disabled layui-disabled" lay-skin="primary"><span>禁用</span><i class="layui-icon layui-icon-ok"></i></div>
        </div>

        <script type="text/javascript">
            layui.use("form", function () {
                var form = layui.form;

                //监听提交
                form.on("submit(formDemo)", function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return false;
                });
            });
        </script>
    </body>
</html>
